/*
 * Instance.h
 *
 *  Created on: 2011-8-2
 *      Author:
 */

#ifndef INSTANCE_H_
#define INSTANCE_H_
#include <vector>
#include <tinyxml.h>

#include "type.h"
#include "SwfObject.h"
#include "Trait.h"
namespace swfstream {

class Instance: public swfstream::SwfObject {
public:
	Instance();
	virtual ~Instance();
	uint32 name;
	uint32 superName;
	uint8 flags;
	uint32 protectedNs;
	uint32 interfaceCount;
	std::vector<uint32> interface;
	uint32 iinit;
	uint32 traitCount;
	std::vector<Trait*> trait;
	TiXmlElement* toTiXmlElement(){
		TiXmlElement*r=new TiXmlElement("_Instance");
		r->SetAttribute("name",name);
		r->SetAttribute("superName",superName);
		r->SetAttribute("flags",flags);
		if(flags&8){
			r->SetAttribute("protectedNs",protectedNs);
		}
		r->SetAttribute("interfaceCount",interfaceCount);
		r->SetAttribute("iinit",iinit);
		r->SetAttribute("traitCount",traitCount);
		return r;
	}
	//std::vector<>
};

} /* namespace swfstream */
#endif /* INSTANCE_H_ */
